package com.example.springboot.dbconfig;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author qibao
 * @version v0.1 2020/11/24
 */
@RequestMapping("/dbconfig")
@RestController
public class ConfigController {
    @Autowired
    ConfigurableEnvironment env;

    @RequestMapping("/test")
    public String test() {
        String PERIOD = env.getProperty("dbPropertySource");
        PERIOD = env.getProperty("ConfKey");
        PropertySource propertySource = env.getPropertySources().get("dbPropertySource");
        String name = propertySource.getName();
        String s = propertySource.getProperty("12345").toString();
        String proper = env.getProperty("12345");
        return PERIOD;
    }
}
